package com.eclink.asset.asset.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.eclink.asset.asset.domain.dao.AssetDepreciation;
import com.eclink.asset.asset.domain.dao.AssetFile;
import com.eclink.asset.asset.mapper.AssetDepreciationMapper;
import com.eclink.asset.asset.mapper.AssetFileMapper;
import com.eclink.asset.domain.AssetCategory;
import com.eclink.asset.pojo.query.AssetItemQuery;
import com.eclink.asset.service.AssetCategoryService;
import com.eclink.asset.sys.service.SysUserService;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 资产清单表Service业务层处理
 *
 *
 * @author zcc
 */
@Service
public class AssetDepreciationService {

    @Resource
    private AssetDepreciationMapper assetDepreciationMapper;


    /**
     * 查询资产清单表列表
     *
     * @return 资产清单表
     */
    public AssetDepreciation getInfo() {
        List<AssetDepreciation> list = assetDepreciationMapper.selectList(null);
        if (list == null || list.isEmpty()) {
            return null;
        }
        return list.get(0);
    }

    /**
     * 保存
     *
     * @param entity 对象

     */
    public void save(AssetDepreciation entity) {
        if (entity.getId()!=null && entity.getId()>0) {
            assetDepreciationMapper.updateById(entity);
        } else {
            assetDepreciationMapper.insert(entity);
        }
    }

}
